export interface ResponseData {
    status: number
    success?: {
        message: string
    }
    error?: {
        message: string
        code: number
    }
}


// 物料分组的停用和启用 请求参数
export interface MaterialGroupUse{
    id: number
}


// 物料分组的停用和启用 返回参数
export interface MaterialGroupUseResp extends ResponseData {}


// 物料的停用和启用
export interface  MaterialUse{
    id: number
}


// 物料的停用和启用 返回参数
export interface MaterialUseUseResp extends ResponseData {}


// 物料分组 增删改查
type use_data_mode = 'create' | 'delete' | 'update' | 'read'
type record_json_type = {
    create: {
        mnemonic: string
        name: string
    }
    delete: {
        id: number
    }
    update: {
        id: number
        mnemonic: string
        name: string
        weight_fix: number
        disable_weight_fix: number
    }
    read: {
        id: number
    }
}
type record_json_type1 = {
    create: {}
    delete: {}
    update: {}
    read: MaterialGroupList
}
export type MaterialGroupList = {
    id: number
    mnemonic: string
    name: string
    operator__username: string
    enable: boolean
    operate_date_: string
    weight: string
    theory_weight: string
    disable_weight: string
    disable_theory_weight: string
    weight_fix: number
    disable_weight_fix: number
}


// 物料分组增删改查 请求参数
export interface MaterialGroup<T extends use_data_mode = use_data_mode> {
    param: record_json_type[T]
    mode: T
}


// 物料分组增删改查 返回参数
export interface MaterialGroupCRUDResp<T extends use_data_mode = use_data_mode> extends ResponseData {
    date: record_json_type1[T]
}


// 物料分组 模糊搜索 请求参数
export interface MaterialGroupFuzzySearch{
    enable: 'enable' | 'not_enable' | 'all'
    mnemonic?: string | null
    name?: string | null
    start: number
    stop: number
}


// 物料分组 模糊搜索 返回参数
export interface MaterialGroupFuzzySearchResp extends ResponseData {
    data: {
        result: MaterialGroupList[],
        total: number,
    }
}

